package com.wf.ew.quartz.sample;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author : Doman
 * @version ：1.0
 * @date : 2020-02-03 23:43
 */
public class HelloJob implements Job {

    public HelloJob() {
        System.out.println("欢迎访问HelloJob");
    }

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        Date date = new Date();
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String dateStr = df.format(date);
        System.out.println("数据备份时间:"+dateStr);

    }
}
